<template>
    <div class='motai' v-show="flag1">
        <div class="smallbox">
       <!--    <span >登录</span>|
            <span>注册</span> -->
        <button class="denglubtn" @click="showlogin('Login')">登录</button>|
        <button class="zhucebtn" @click="showlogin('Register')">注册</button>     
        <component :is="a"></component>
        <img src="../img/close.png" alt="" @click="yingchang()" >
        </div>
        
    </div>
</template>
<script>
import Login from "./login.vue"
import Register from "./register.vue"
    export default {
        data() {
            return {
                a:"Login",
                flag1: true
            }
        },
        methods: {
              showlogin(arg){
                this.a=arg
            } ,
            yingchang(){
            //    console.log(this.$refs.close.classList); 
                // this.$refs.close.classList.add("display1")
                // this.$emit("myclick") 
                this.flag1 = false;

            }

        },
        components:{
            Login,
            Register
        },
        mounted:()=> {
         
        },
    }
</script>
<style scoped lang="scss">
.motai{
    width: 100%;
    height:900px;
    position: fixed;
    left: 0px;//-1160
    top: 0px;//-200px
    z-index: 2000;
    background-color: rgba(30,30,30,.5);
    @media  screen and (max-width:1263px) {
        .smallbox{
            width: 1200px;
        }
    }
}
 
.smallbox{
    width: 70%;
    height: 600px;
    margin: 50px auto;
    text-align: center;
    background-color: #fff;
    position:relative;
   
}
.smallbox img{
    width: 30px;
    height: 30px;
    position: absolute;
    right: 5px;
    top: 5px;
    
}
.smallbox .denglubtn,.zhucebtn{
width: 8%;
height: 40px;
/* background-image: url(https://resource.mhxk.com/manhuatai_pc/static/images/login/login-btn.png);
background-size:8% 40px ; */
background-color: #489AFF;
border: 0;
color: white;
border-radius: 5px;
margin-top: 50px;
margin-bottom: 20px;
font-size: 18px;
}
.display1{
    display: none;
    overflow: hidden;
}
</style>